
var $ = function (s) {
    return document.getElementById(s);
};
var $list = function (a) {
    return document.getElementsByClassName(a);
};
var win_width = 0;
var win_height = 0;
window.onresize = function () {
    //重新将背景层 设置 高度和宽度
    document.getElementById("back").style.width=document.documentElement.clientWidth+"px";
    document.getElementById("back").style.height=document.documentElement.clientHeight+"px";
    document.getElementById("div").style.top=(document.documentElement.clientHeight - height)/2 +"px";
    document.getElementById("div").style.left=(document.documentElement.clientWidth - width)/2 +"px";
};

var win = function (width,height,title,url) {
    // var close = function () {
    //     document.body.removeChild(_back);
    //     document.body.removeChild(_sdiv);
    // };
    //背景层
    var _back = document.createElement('div');
    _back.style.width = document.documentElement.clientWidth + "px";
    _back.style.height = document.documentElement.clientHeight + "px";
    _back.style.backgroundColor = "#b7bec1";
    _back.style.opacity = "0.8";
    _back.style.position = "absolute";
    _back.style.top = 0;
    _back.id ="back";
    _back.style.left = 0;
    _back.style.color = "black";
    document.body.appendChild(_back);
    //窗口
    var _div = document.createElement("div");
    _div.style.width = width+"px";
    _div.style.height = height+"px";
    _div.id = "div";
    _div.style.backgroundColor = "#bfbfbf";
    _div.style.position = "absolute";
    _div.style.top = (document.documentElement.clientHeight - height)/2 +"px";
    _div.style.left = (document.documentElement.clientWidth - width)/2 +"px";
    document.body.appendChild(_div);
//标题
    var _title = document.createElement("div");
    _title.style.textAlign = "center";
    _title.style.borderBottom = '1px,solid,#6f6f6f';
    _title.textContent = title;
    _div.appendChild(_title);
    //窗口的内容
    var _content = document.createElement("iframe");
    _content.style.width = "580px";
    _content.style.height = height - 40+"px";
    _content.id = "content";
    _content.src = "form.html";
    _div.appendChild(_content);









    // <frameset rows='120,*' >
    //     <frame src='top.html'
    // noresize = 'noresize'
    // scrolling='no'
    // style='background-color:#c7c6d9'/>
    //     <frameset cols = '200,*'>
    //     <frame src='left.html' style='background-color:#c7c6d9' />
    //     <frame name= 'center' src = 'center.html'style='background-color:#c7c6d9'  />
    //     </frameset>
    //     </frameset>
};
